<?php

/**
 * wfmodele form base class.
 *
 * @method wfmodele getObject() Returns the current form's model object
 *
 * @package    e-DSL
 * @subpackage form
 * @author     Your name here
 * @version    SVN: $Id: sfDoctrineFormGeneratedTemplate.php 29553 2010-05-20 14:33:00Z Kris.Wallsmith $
 */
abstract class BasewfmodeleForm extends BaseFormDoctrine
{
  public function setup()
  {
    $this->setWidgets(array(
      'id'                          => new sfWidgetFormInputHidden(),
      'owner_id'                    => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('owner'), 'add_empty' => true)),
      'code'                        => new sfWidgetFormInputText(),
      'description'                 => new sfWidgetFormInputText(),
      'etatinitial_id'              => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('etatinitial'), 'add_empty' => true)),
      'readOnly'                    => new sfWidgetFormInputCheckbox(),
      'scriptDeterminationValideur' => new sfWidgetFormTextarea(),
      'activeStatus'                => new sfWidgetFormInputText(),
      'created_at'                  => new sfWidgetFormDateTime(),
      'updated_at'                  => new sfWidgetFormDateTime(),
    ));

    $this->setValidators(array(
      'id'                          => new sfValidatorChoice(array('choices' => array($this->getObject()->get('id')), 'empty_value' => $this->getObject()->get('id'), 'required' => false)),
      'owner_id'                    => new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('owner'), 'required' => false)),
      'code'                        => new sfValidatorString(array('max_length' => 10, 'required' => false)),
      'description'                 => new sfValidatorString(array('max_length' => 50, 'required' => false)),
      'etatinitial_id'              => new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('etatinitial'), 'required' => false)),
      'readOnly'                    => new sfValidatorBoolean(array('required' => false)),
      'scriptDeterminationValideur' => new sfValidatorString(array('required' => false)),
      'activeStatus'                => new sfValidatorInteger(),
      'created_at'                  => new sfValidatorDateTime(),
      'updated_at'                  => new sfValidatorDateTime(),
    ));

    $this->widgetSchema->setNameFormat('wfmodele[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    $this->setupInheritance();

    parent::setup();
  }

  public function getModelName()
  {
    return 'wfmodele';
  }

}
